﻿/******************************************************************************************************
Copyright (c) 2014 Steven Giacomelli (stevegiacomelli@gmail.com)

Permission is hereby granted, free of charge, to any person obtaining a copy of this
software and associated documentation files (the "Software"), to deal in the Software
without restriction, including without limitation the rights to use, copy, modify,
merge, publish, distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies
or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************************************************/

namespace SharpGeo
{
    /// <summary>
    /// A static class that stores the standard scales
    /// </summary>
    public static class StandardScales
    {
        /// <summary>
        /// Scale 00
        /// </summary>
        public const double Scale00 = 591657550.5;

        /// <summary>
        /// Scale 01
        /// </summary>
        public const double Scale01 = 295828775.3;

        /// <summary>
        /// Scale 02
        /// </summary>
        public const double Scale02 = 147914387.6;

        /// <summary>
        /// Scale 03
        /// </summary>
        public const double Scale03 = 73957193.82;

        /// <summary>
        /// Scale 04
        /// </summary>
        public const double Scale04 = 36978596.91;

        /// <summary>
        /// Scale 05
        /// </summary>
        public const double Scale05 = 18489298.45;

        /// <summary>
        /// Scale 06
        /// </summary>
        public const double Scale06 = 9244649.227;

        /// <summary>
        /// Scale 07
        /// </summary>
        public const double Scale07 = 4622324.614;

        /// <summary>
        /// Scale 08
        /// </summary>
        public const double Scale08 = 2311162.307;

        /// <summary>
        /// Scale 09
        /// </summary>
        public const double Scale09 = 1155581.153;

        /// <summary>
        /// Scale 10
        /// </summary>
        public const double Scale10 = 577790.5767;

        /// <summary>
        /// Scale 11
        /// </summary>
        public const double Scale11 = 288895.2884;

        /// <summary>
        /// Scale 12
        /// </summary>
        public const double Scale12 = 144447.6442;

        /// <summary>
        /// Scale 13
        /// </summary>
        public const double Scale13 = 72223.82209;

        /// <summary>
        /// Scale 14
        /// </summary>
        public const double Scale14 = 36111.91104;

        /// <summary>
        /// Scale 15
        /// </summary>
        public const double Scale15 = 18055.95552;

        /// <summary>
        /// Scale 16
        /// </summary>
        public const double Scale16 = 9027.977761;

        /// <summary>
        /// Scale 17
        /// </summary>
        public const double Scale17 = 4513.98888;

        /// <summary>
        /// Scale 18
        /// </summary>
        public const double Scale18 = 2256.99444;

        /// <summary>
        /// Scale 19
        /// </summary>
        public const double Scale19 = 1128.49722;

        /// <summary>
        /// Returns a standard scale
        /// </summary>
        /// <param name="scale">The standard scale</param>
        /// <returns>The standard scale in meters</returns>
        public static double GetScale(int scale)
        {
            switch (scale)
            {
                case 0:
                    return Scale00;

                case 1:
                    return Scale01;

                case 2:
                    return Scale02;

                case 3:
                    return Scale03;

                case 4:
                    return Scale04;

                case 5:
                    return Scale05;

                case 6:
                    return Scale06;

                case 7:
                    return Scale07;

                case 8:
                    return Scale08;

                case 9:
                    return Scale09;

                case 10:
                    return Scale10;

                case 11:
                    return Scale11;

                case 12:
                    return Scale12;

                case 13:
                    return Scale13;

                case 14:
                    return Scale14;

                case 15:
                    return Scale15;

                case 16:
                    return Scale16;

                case 17:
                    return Scale17;

                case 18:
                    return Scale18;

                case 19:
                default:
                    return Scale19;
            }
        }
    }
}